Skip to content

fix(cli): exit after printing the version instead of opening a session - #1726

Open
charliezong18 wants to merge 1 commit into
slopus:mainfrom
charliezong18:fix/version-flag-should-not-start-session
Open

fix(cli): exit after printing the version instead of opening a session#1726
charliezong18 wants to merge 1 commit into
slopus:mainfrom
charliezong18:fix/version-flag-should-not-start-session

Conversation

@charliezong18

Copy link
Copy Markdown
Contributor

happy --version prints the version and then deliberately falls through to auth, daemon startup and runClaude. On a machine without stored credentials that means a version query drops into the interactive login picker — which is what #1532 reports.

Exit right after printing, the same way the --help branch above already does.

Fixes #1532

Proof

Run from source against an isolated HAPPY_HOME_DIR (no stored credentials), stdin closed, 20s hard timeout.

Before — main:

happy version: 1.2.1

How would you like to authenticate?

› 1. Mobile App
  2. Web Browser

Use arrows or 1-2 to select, Enter to confirm

  ERROR Raw mode is not supported on the current process.stdin, which Ink uses

After — this branch:

happy version: 1.2.1

Nothing else runs: no auth, no daemon, no session.

Validation

  • happy-cli typecheck: no new errors relative to main
  • One behavioural line in packages/happy-cli/src/index.ts; no other file touched
  • index.ts has not been modified upstream since this fix was written, so it applies without drift

🤖 Generated with Claude Code

--version printed the Happy version and then deliberately fell through to auth,
daemon startup and runClaude. On a machine without stored credentials that means
a version query drops into the interactive login picker.

Exit right after printing, the same way the --help branch above already does.

Fixes slopus#1532
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

--version is broken. It starts a new claude session instead

1 participant